package com.atguigu.gulimall.search.feign;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.search.feign.fallback.ProductFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @create: 2024/9/3
 * @author: gyhe10
 * @description: 远程调用 product 服务的 Feign 接口
 **/

@FeignClient(value = "gulimall-product", fallback = ProductFeignServiceFallback.class)
public interface ProductFeignService {

    @GetMapping("/product/attr/info/{attrId}")
    R getAttrInfo(@PathVariable("attrId") Long attrId);

    @GetMapping("/product/brand/infos")
    R getBrandsInfo(@RequestParam("brandIds") List<Long> brandIds);
}
